﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DAL.User>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Manage User</h2>
    <%using (Html.BeginForm("Action", "User", FormMethod.Post, new { id = Model.Id }))
      { %>
    <table width="500px">
        <tr>
            <td style="width:120px;">ID</td>
            <td style="width:380px;"><%=Html.Label(Model.Id.ToString())%></td>
        </tr>
        <tr>
            <td>User ID</td>
            <td><%:Html.TextBox("Name", Util.Common.CommonUtility.GetString(Model.Name))%></td>
        </tr>
        <tr>
            <td>Full Name:</td>
            <td><%:Html.TextBox("FullName", Util.Common.CommonUtility.GetString(Model.FullName), new { @style = "width:250px;" })%></td>
        </tr>
        <tr>
            <td>Email</td>
            <td><%:Html.TextBox("Email", Util.Common.CommonUtility.GetString(Model.Email), new { @style="width:250px;"})%></td>
        </tr>
        <tr>
            <td>
                Administrator
            </td>
            <td>
                <%: Html.CheckBox("chkAdministrator",Model.RoleId ==1)%>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                
                <input type="submit" value="Save" id="Update" name="Update"/>
                <input type="submit" value="Reset Password" id="ResetPassword" name="ResetPassword"/>
                <%:Html.Hidden("id", Model.Id)%>
            
            </td>                     
        </tr>
        <%if (ViewData["ResetPwd"] != null)
          {%>
            <tr>
                <td colspan="2">Reset password has been sent to member!</td>
            </tr>
        <%} %>
         <%if (ViewData["Update"] != null)
           {%>
             <%if (ViewData["Update"].ToString().Equals("Success"))
               {%>
            <tr>
                <td colspan="2">User information successfully updated!</td>
            </tr>
        <%}
               else
               { %>
            <tr>
                <td colspan="2">User information update fails!</td>
            </tr>
        <%} %>
        <%} %>

    </table>
    <%} %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
